package com.xy.etl.log;

/**
 * 日志扩展
 */
public class EtlLog {

    /**
     * 日志扩展
     */
    private static final ThreadLocal<String> logNoteCache = new ThreadLocal<>();

    /**
     * 设置日志扩展
     *
     * @param note
     */
    public static void setLogNote(String note) {
        logNoteCache.set(note);
//        System.out.println("set** " + Thread.currentThread().getId() + "  ," + note + "  classloader:" + EtlLog.class.getClassLoader());
    }

    /**
     * 取得日志扩展
     */
    public static String getLogNote() {
        String note = logNoteCache.get();
//        System.out.println("get** " + Thread.currentThread().getId() + "  ," + note + "  classloader:" + EtlLog.class.getClassLoader());
        return note;
    }

    /**
     * 清理日志
     */
    public static void clearLogNote() {
        logNoteCache.remove();
    }
}
